<template>
    <view class="iot-tabs">
        <view class="iot-tabs-title">
            <view :class="'iot-title-item ' + (item.isActive ? 'active' : '')" @tap="handleitemtab" :data-index="index" v-for="(item, index) in tabs" :key="item.id">
                {{ item.value }}
            </view>
        </view>
        <view class="iot-tabs-content"></view>
        <slot></slot>
    </view>
</template>

<script>
// components/SearchInput/tabs/tabs.js
export default {
    data() {
        return {};
    },
    /**
     * 组件的属性列表
     */
    props: {
        tabs: {
            type: Array,
            default: () => []
        }
    },
    /**
     * 组件的方法列表
     */
    methods: {
        handleitemtab(e) {
            const { index } = e.currentTarget.dataset;
            this.$emit('tabsitemchange', {
                detail: {
                    index
                }
            });
        }
    }
};
</script>
<style>
@import './Tabs.css';
</style>
